home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / clip2iff30frm.rexx < prev    next >
OS/2 REXX Batch file  |  1996-04-23  |  2KB  |  97 lines

  1. /* Clip2IFF30Frm.rexx V2.0 -- Export a clip as IIF Files */
  2. /* By Bob Caron © 1995 NewTek Inc.                    */
  3.  
  4. parse arg InClipName","OutClipName","StartFrame","EndFrame
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9.  
  10. IFFBaseName=OutClipName
  11. if EndFrame="" then do
  12.  'Askb'"Please select;A source clip."
  13.  exit
  14.  end
  15.  
  16. if ~show('l','rexxsupport.library') then do
  17.   if ~addlib('rexxsupport.library',0,-30,34) then do
  18.     exit
  19.   end
  20. end
  21.  
  22. dots=0
  23. XWin = 100
  24. YWin = 40
  25. Clear = d2c(12)
  26. nv = ''
  27. cr = '0a'x
  28. call getfontsize
  29.  
  30. wid = width*48
  31. hei = theight+height*10
  32.  
  33. if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/Clip2IFF30Frm Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  34.     exit
  35. end
  36.  
  37. if inclipname="" then do
  38.   'Askb'"You need a;Source Clip!"
  39.   exit
  40.   end
  41.  
  42.  i=0
  43.  endframe=StartFrame+((EndFrame-StartFrame)/2)
  44.  OutName=IFFBaseName||"."||i
  45.  do i = StartFrame to EndFrame
  46.         call OpenWindow(InclipName,OutName,i,EndFrame,i)
  47.         'Gnfm'                                                  /* Get Field and inc */
  48.         OutName=IFFBaseName||"."||i       /* Setup save name */
  49.         call OpenWindow(InclipName,OutName,i,EndFrame,i)
  50.         'Asav'OutName                                           /* Write out RGB */
  51.  end
  52. exit
  53.  
  54. OpenWindow:
  55. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  56.   pdots="...."
  57.   dots=dots+1
  58.   if dots>4 then dots=1
  59.   call writech('Window',Clear||nv||cr)
  60.   call writech('Window','Current Source Clip ['InClipName']'cr)
  61.   call writech('Window','  Current Dest IFF  ['OutClipName']'cr)
  62.   call writech('Window',''cr)
  63.   call writech('Window','Current Frame: 'Frame''cr)
  64.   call writech('Window','    End Frame: 'EndFrame''cr)
  65.   call writech('Window',''cr)
  66.   call writech('Window','Processing'right(pdots,dots)||cr)
  67.  
  68. return
  69.  
  70.  
  71. getfontsize:
  72.  
  73. if open('font','env:sys/font.prefs','R') then do
  74.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  75.    call close('font')
  76.    font = substr(font,index(font,'FONT')+4)
  77.    font = substr(font,index(font,'FONT')+4)
  78.    height = c2d(substr(font,29,2))
  79.    tfont = substr(font,index(font,'FONT')+4)
  80.    theight = c2d(substr(tfont,29,2))
  81.    font = substr(font,33)
  82.    font = left(font,index(font,d2c(0))-1-5)
  83.    if open('font','FONTS:'font'/'height,'R') then do
  84.       width = c2d(right(readch('font',116),2))
  85.       call close('font')
  86.   end
  87.   else if height=9 then width = 10
  88.                    else width = 8
  89. end
  90.   else do
  91.   theight = 8
  92.   height = 8
  93.   width = 8
  94. end
  95.  
  96. return
  97.